<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>The RarException class</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="rarentry.tostring.html">RarEntry::__toString</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="rarexception.isusingexceptions.html">RarException::isUsingExceptions</a></div>
 <div class="up"><a href="book.rar.html">Rar</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="class.rarexception" class="reference">

 <h1 class="title">The RarException class</h1>
 

 <div class="partintro"><p class="verinfo">(PECL rar &gt;= 2.0.0)</p>


  <div class="section" id="rarexception.intro">
   <h2 class="title">简介</h2>
   <p class="para">
    This class serves two purposes: it is the type of the exceptions thrown by the RAR extension
    functions and methods and it allows, through static methods to query and define the error
    behaviour of the extension, i.e., whether exceptions are thrown or only warnings are emitted.
   </p>
   <p class="para">
    The following error codes are used:
   </p>
   <ul class="itemizedlist">
    <li class="listitem">
     <span class="simpara">
      -1 - error outside UnRAR library
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      11 - insufficient memory
     </span>
    </li>
    
    <li class="listitem">
     <span class="simpara">
      12 - bad data
     </span>
    </li>
    
    <li class="listitem">
     <span class="simpara">
      13 - bad archive
     </span>
    </li>
    
    <li class="listitem">
     <span class="simpara">
      14 - unknown format
     </span>
    </li>
    
    <li class="listitem">
     <span class="simpara">
      15 - file open error
     </span>
    </li>
    
    <li class="listitem">
     <span class="simpara">
      16 - file create error
     </span>
    </li>
    
    <li class="listitem">
     <span class="simpara">
      17 - file close error
     </span>
    </li>
    
    <li class="listitem">
     <span class="simpara">
      18 - read error
     </span>
    </li>
     <li class="listitem">
     <span class="simpara">
      19 - write error
     </span>
    </li>
 
    <li class="listitem">
     <span class="simpara">
      20 - buffer too small
     </span>
    </li>
 
    <li class="listitem">
     <span class="simpara">
      21 - unkown RAR error
     </span>
    </li>
 
    <li class="listitem">
     <span class="simpara">
      22 - password required but not given
     </span>
    </li>
   </ul>
  </div>


  <div class="section" id="rarexception.synopsis">
   <h2 class="title">类摘要</h2>


   <div class="classsynopsis">
    <div class="ooclass"></div>


    <div class="classsynopsisinfo">
     <span class="ooclass">
      <span class="modifier">final</span>
      <strong class="classname">RarException</strong>
     </span>
     
     <span class="ooclass">
      <span class="modifier">extends</span>
      <a href="class.exception.html" class="classname">Exception</a>
     </span>
     {</div>


    <div class="classsynopsisinfo classsynopsisinfo_comment">/* 方法 */</div>
    <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="modifier">static</span> <span class="type">bool</span><span class="methodname"><a href="rarexception.isusingexceptions.html" class="methodname">isUsingExceptions</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="modifier">static</span> <span class="type">void</span><span class="methodname"><a href="rarexception.setusingexceptions.html" class="methodname">setUsingExceptions</a></span>
    ( <span class="methodparam"><span class="type">bool</span> <code class="parameter">$using_exceptions</code></span>
   )</div>

    
    <div class="classsynopsisinfo classsynopsisinfo_comment">/* 继承的方法 */</div>
    <div class="methodsynopsis dc-description">
   <span class="modifier">final</span> <span class="modifier">public</span> <span class="type">string</span><span class="methodname"><a href="exception.getmessage.html" class="methodname">Exception::getMessage</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">final</span> <span class="modifier">public</span> <span class="type">Exception</span><span class="methodname"><a href="exception.getprevious.html" class="methodname">Exception::getPrevious</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">final</span> <span class="modifier">public</span> <span class="type">int</span><span class="methodname"><a href="exception.getcode.html" class="methodname">Exception::getCode</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">final</span> <span class="modifier">public</span> <span class="type">string</span><span class="methodname"><a href="exception.getfile.html" class="methodname">Exception::getFile</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">final</span> <span class="modifier">public</span> <span class="type">int</span><span class="methodname"><a href="exception.getline.html" class="methodname">Exception::getLine</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">final</span> <span class="modifier">public</span> <span class="type">array</span><span class="methodname"><a href="exception.gettrace.html" class="methodname">Exception::getTrace</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">final</span> <span class="modifier">public</span> <span class="type">string</span><span class="methodname"><a href="exception.gettraceasstring.html" class="methodname">Exception::getTraceAsString</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">string</span> <span class="methodname"><a href="exception.tostring.html" class="methodname">Exception::__toString</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">final</span> <span class="modifier">private</span> <span class="type">void</span><span class="methodname"><a href="exception.clone.html" class="methodname">Exception::__clone</a></span>
    ( <span class="methodparam">void</span>
   )</div>


   }</div>


  </div>

 </div>

 















<h2>Table of Contents</h2><ul class="chunklist chunklist_reference"><li><a href="rarexception.isusingexceptions.html">RarException::isUsingExceptions</a> — Check whether error handling with exceptions is in use</li><li><a href="rarexception.setusingexceptions.html">RarException::setUsingExceptions</a> — Activate and deactivate error handling with exceptions</li></ul>
</div>
<hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="rarentry.tostring.html">RarEntry::__toString</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="rarexception.isusingexceptions.html">RarException::isUsingExceptions</a></div>
 <div class="up"><a href="book.rar.html">Rar</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
